import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint"; //校验ts代码
import pluginVue from "eslint-plugin-vue"; //校验vue代码
import prettierRecommended from "eslint-plugin-prettier/recommended";

export default [
  {
    ignores: ["node_modules/**", "dist/**", "build/**", "public/**", "*.d.ts"]
  },
  {
    files: ["**/*.{js,mjs,cjs,ts,mts,cts,vue}"],
    languageOptions: {
      globals: { ...globals.browser, ...globals.node }
    }
  },
  js.configs.recommended,
  ...tseslint.configs.recommended,
  ...pluginVue.configs["flat/essential"],
  {
    files: ["**/*.vue"],
    languageOptions: {
      parserOptions: {
        parser: "@typescript-eslint/parser"
      }
    }
  },
  {
    rules: {
      "no-console": "warn",
      "vue/multi-word-component-names": "off"
        "no-unused-vars": "true"
    }
  },
  prettierRecommended
];
